<template>
	<view>
		<view>
			<image class="topImage" src="../../static/image/bg2.png" mode=""></image>
			<view class=" bgw text-lg p30">
				<view class="list ">
					<view>商铺名称 :</view>
					<view><input v-model="name" type="text" disabled /></view>
				</view>
				<view class="list">
					<view>商铺简称 :</view>
					<view><input v-model="nameAbbr" type="text" disabled /></view>
				</view>
				<view class="list">
					<view>商铺地址 :</view>
					<!-- @tap="addressTab()" -->
					<view>{{address}}</view>
				</view>
				<view class="list list2">
					<view>详细地址 :</view>
					<view style="padding-top: 24rpx;"><textarea v-model="addresss" maxlength="50" disabled placeholder="如街道、小区、楼牌号、单元门牌号等" /></view>
				</view> 
			</view>
			
			<view class="mt30 bgw text-lg p30"> 
				<view @tap="GoSetMobile()" class="list">
					<view>手机号 </view>
					<view>
						<input v-model="telephone" type="number" maxlength="11" disabled placeholder="请输入商铺联系人电话" />
						<image class="go" src="../../static/image/go1.png" mode=""></image>
					</view>
				</view>
			<!-- 	<view class="list">
					<view>经营类目 :</view>
					<view >{{labelTxt}}</view> 
				</view> -->
				<view @tap="GobusinessScope()" class="list">
					<view>经营范围 :</view>
					<view>
						<input v-model="businessScope"  disabled placeholder="请填写经营范围" />
						<image class="go" src="../../static/image/go1.png" mode=""></image>
					</view>
				</view>
				<view @tap="GoTimeSet()" class="list">
					<view>营业日期 :</view> 
					<view>{{time1}}</view> 
					<image class="go" src="../../static/image/go1.png" mode=""></image>
				</view> 
				<view @tap="Godescription()" class="list list2">
					<view>详细介绍 :</view>
					<view style="padding-top: 24rpx;">
						<textarea v-model="description" disabled  maxlength="50" placeholder="店铺介绍、活动详情（最多200个字符）" />
						<image class="go" src="../../static/image/go1.png" mode=""></image>
					</view>
				</view>
			</view>
			<!-- 身份证 -->
			<view class="idImage bgw p30">
				<p>身份证</p> 
				<view   class="img img2">
					<image :src="idcardFrontImg" mode=""></image> 
				</view> 
				<view  class="img img2">
					<image :src="idcardBehindImg" mode=""></image>
				</view>
			</view>			
			<!-- 商铺照片 -->
			<view class="idImage bgw p30">
				<p>门店相关照片</p> 
				<view   class="img img2">
					<image :src="doorImg" mode=""></image> 
				</view> 
				<view  class="img img2"> 
					<image :src="licenceImg" mode=""></image> 
				</view>
			</view>			
		</view>  
	</view>
</template>

<script> 
	import {storeinfo,storeCategoryList} from '@/api/api.js'
	import {datas1} from '../shopNews/data.js'
export default { 
	data() {
		return {
			shakeState:0,
			name: '', //门店名称
			nameAbbr:'', // 门店简称
			areaId:'', // 所在区县
			province:'',// 所在省
			city:'',//所在市
			zone:'', // 所在区
			addresss:'',//详细地址
			longitude:'', //经度
			latitude:'',//维度
			telephone: '',  //手机号
			businessScope:'' ,//经营范围 
			description:'', //详细介绍
			salesman:'',//业务代表
			categoryId:'',//店铺类别
			doorImg :'',//门头照
			licenceImg:'',//营业执照
			idcardFrontImg:'', //身份证 正面
			idcardBehindImg:'', //身份证 反面
			businessHours:'', //营业时间
			address: '请选择省市区',    
			selectList:[],
			labelTxt:'请选择经营类目', 
			taimeArr1:datas1,
			time1:'请选择营业日期',
			time2:'请选择开始时间',
			time3:'请选择结束时间',
			$token:''
		}
	}, 
	created() {
		
	},
	onShow() {
		this.$token = uni.getStorageSync('token')
		this.start()  
		this.shakeState = 0 
	},
	methods: { 
		GoTimeSet(){
			uni.navigateTo({
				url:'../timeSet/timeSet'
			})
		},
		async init() {
			let data = await storeCategoryList();
			data = data.datas;
			let arr = [];
			for (let i = 0; i < data.length; i++) {
				 if(data[i].categoryId == this.labelTxt){
					 this.labelTxt = data[i].name
				 }
			}
			this.selectList = arr;
		},
		GoSetMobile(){
			if(this.shakeState == 0){
				this.shakeState = 1
				uni.navigateTo({
					url:'../mobile/mobile'
				})		
			} 
		},
		async start(){
			let data = await storeinfo() 
			data = data.data
			this.name = data.name
			this.nameAbbr = data.nameAbbr 
			
			this.address = data.city
			this.addresss = data.address
			this.labelTxt =  data.categoryId
			
			this.telephone =data.telephone  
			this.businessScope = data.businessScope  
			this.description = data.description 
			this.idcardFrontImg = data.idcardFrontImg 
			this.idcardBehindImg = data.idcardBehindImg 
			this.doorImg = data.doorImg 
			this.licenceImg = data.licenceImg 
			this.longitude = data.longitude   
			
			this.time1 = data.businessHours 
			this.init()
		},
		GobusinessScope(){
			if(this.shakeState == 0){
				this.shakeState = 1
				uni.navigateTo({
					url:'../sortSet/sortSet'
				})		
			}
			
		},
		Godescription(){
			if(this.shakeState == 0){
				this.shakeState = 1
				uni.navigateTo({
					url:'../shopBrief/shopBrief'
				})		
			} 
		}, 
		toast(txt) {
			uni.showToast({
				title: txt,
				icon: 'none',
				mask: true,
				duration: 800
			});
		}
	}
};
</script>

<style lang="less" scoped>
@import '../shopNews/index.less';
@import './index.less';
</style>
